<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    .mydiv{
      width: 400px;
      height: 200px;
      background-color: pink;
    }
  </style>
</head>
<body>
  <div class="mydiv"></div>
  <img src="/img/2.png" id="myimg" style="width: 400px;" onkeydown="myfun()">
  <button onclick="change()" id="mybtn">123</button>
</body>
<script src="/jQuery/jquery-3.7.1.js"></script>
<script>
  var mydiv=document.querySelector('div')
  var mubtn=document.querySelector('#mybtn')
  var myimg=document.querySelector('#myimg')
  console.log(mubtn);
  mydiv.innerHTML='1111'
  mydiv.style.backgroundColor='blue'

  function getRandom(N,M){
    return Math.floor(Math.random()*(M-N+1)+N)
  }

  function change(){
    var random=getRandom(1,6)
    myimg.src=`/img/${random}.png`
  }
  function myfun(){
    myimg.src='/img/6.png'
  }
</script>
</html>